<template>
    <div class="navigator">
        <div class="row body">
            <div class="btn-back" @click="onPageBack">
                <img
                    v-if="mode === 'light'"
                    :src="require('@/assets/icon/page_back_light.png')"
                />
                <img
                    v-if="mode === 'dark'"
                    :src="require('@/assets/icon/page_back_dark.png')"
                />
            </div>
            <slot name="center"></slot>
            <slot name="right"></slot>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        mode: {
            type: String,
            default: "light" // dark
        }
    },
    data() {
        return {};
    },

    methods: {
        onPageBack() {
            this.$router.go(-1);
        }
    }
};
</script>


<style lang="less" scoped>
.navigator {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100px;

    .body {
        .btn-back {
            box-sizing: border-box;
            padding: 25px;
            width: 100px;
            height: 100px;
        }
    }
}
</style>